package com.typhoon.jdbcTemplateHA.consumer;

import java.util.List;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.alibaba.fastjson.JSON;
import com.typhoon.jdbcTemplateHA.entity.User;
import com.typhoon.jdbcTemplateHA.service.UserService;
import com.typhoon.jdbcTemplateHA.util.SpringContextUtil;

public class HAJdbcConsumer {

	public static void main(String[] args) {
		new ClassPathXmlApplicationContext("spring-root.xml").start();

		UserService userService = SpringContextUtil.getBean("userService", UserService.class);
		List<User> list = null;
		for (int i = 0; i < 10; i++) {
			list = userService.selectAll();
			System.out.println(JSON.toJSONString(list));
		}
	}

}
